

<%= javascript_include_tag "jquery/jquery-1.3.2.min.js" %>
<style>
.title {
  height:76px;
  line-height:56px;
  overflow:hidden;
  text-align:center;
  margin-top:-30px;
}
.title {
  line-height:56px;
  text-align:center;
}
.title h2 {
color:#336699;
font-size:24px;
}
.intro {
background:none repeat scroll 0 0 #FAFDFE;
border:1px solid #DDDDDD;
color:#666666;
font-size:14px;
line-height:25px;
margin-top:8px;
padding:8px 16px;
}
.content {
color:#333333;
font-size:14px;
line-height:25px;
padding:12px 16px;
}
</style>
			<div class="title">
				<h2><%= @survey.name %></h2>
			</div><!-- /title -->
			<div class="info">
			<!--
				<small>时间:</small>2010-01-29 10:20<small>来源:</small>未知 <small>作者:</small>admin
        <small>点击:</small><script src="29_files/count.html" type="text/javascript" language="javascript"></script>123
      -->
      </div>

      <div class="intro"><%= @survey.description %></div>
			<div class="content">
			<table width="100%">
				<tbody><tr><td><p>
<div>
  <% form_for @survey, :url => {:action => 'report', :id => @survey} do |f| -%>
  
    <%= hidden_field_tag 'survey_id', @survey.id %>
  
    <% @survey.questions.each_with_index do |question, index| -%>
    <div id="question<%=index%>" class="questions">
      <p>
        <%= question.description %>
      </p>  
      
      <ol>
      <% for choice in question.choices -%>
        <li>
          <input type="radio" name="question<%=question.id%>value" value="<%=choice.value%>" 
            onclick="next('#question<%=index+1%>', this.value, 
                <%= index+1 == @survey.questions.size ? 1 : 0%>)" />&nbsp;&nbsp;
          <%= choice.content %>
          <%= choice.value %>
        </li>
      <% end -%>
      </ol>
    </div>
    <% end -%>
    
    <div id="submit" style="padding:;">
            测试完毕，请提交<br/><br/><br/>
      <%= f.submit "提交" %>
    </div>
  <% end -%>

</div>
               
				</p></td></tr>
			</tbody></table>
			</div><!-- /content -->
<div>
</div>



<script type="text/javascript">
  function next(next_question, value, is_last) {
    $('.questions').hide();
    $(next_question).show();
    if(is_last == 1) {
      $('#submit').show();
    }
  }

  function isLast(quesiton) {
  
  }

  $('.questions').hide();
  $('#question0').show();
  $('#submit').hide();
</script>
